package com.muyan.design.singleton;

public class SingletonGood {

    private static volatile SingletonGood instance = null; // private constructor

    private SingletonGood() {// suppresses
    }

    public static SingletonGood getInstance() { // if already inited, no need to get
        if (instance == null) {// lock everytime
            synchronized (SingletonGood.class) {
                if (instance == null) {
                    instance = new SingletonGood();
                }
            }
        }
        return instance;
    }
}
